<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<!--
        This program is free software; you can redistribute it and/or modify
        it under the terms of the GNU General Public License as published by
        the Free Software Foundation; either version 2 of the License, or
        (at your option) any later version.
        
        This program is distributed in the hope that it will be useful,
        but WITHOUT ANY WARRANTY; without even the implied warranty of
        MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
        GNU General Public License for more details.
        
        You should have received a copy of the GNU General Public License
        along with this program; if not, write to the Free Software
        Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
        MA 02110-1301, USA.
-->

<html>
	<head>
		<meta HTTP-EQUIV="Pragma" CONTENT="no-cache">
		<meta HTTP-EQUIV="Expires" CONTENT="-1">
		<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
		<link type="text/css" href="../../css/jquery-ui/current/jquery-ui.css" rel="stylesheet" />
		<link type="text/css" href="../../css/iframe.css" rel="stylesheet" />
		<script type="text/javascript" src="../../js/jquery.js"></script>
		<script type="text/javascript" src="../../js/jquery-ui.js"></script>
		<script type="text/javascript" src="../../js/jquery.xslt.js"></script>
		<script type="text/javascript" src="../../js/jquery.form.js"></script>
		<script type="text/javascript" src="../../js/iframe.js"></script>
	</head>
	<body style="font-size:12px;">
		<form action="../../../../bin/kernel.py?func=postmsp" method="post" id="mspform">
			<table align="center" valign="middle" border="0" cellpadding="0" cellspacing="2">
				<tr height="26px">
					<td>Code:</td>
					<td><input type="text" style="width:200px" id="code" name="code"></td>
					<td align="left">Model: 
						<img onClick="javascript:update('model');" src="../../img/update.png" title="Update model..."/>
						<img onClick="javascript:parent.showDialog('modelform');" src="../../img/add.png" title="Add model..."/>
					</td>
				</tr>
				<tr height="26px">
					<td>Description:</td>
					<td colspan="2"><input type="text" style="width:400px" name="description" id="description"></td>
				</tr>
				<tr height="26px">
					<td>Descr. RUS:</td>
					<td colspan="2"><input type="text" style="width:400px" name="description_rus" id="description_rus"></td>
				</tr>
				<tr height="26px">
					<td>Unit: 
						<img onClick="javascript:update('unit');" src="../../img/update.png" title="Update unit..."/>
						<img onClick="javascript:parent.showDialog('unitform');" src="../../img/add.png" title="Add unit..."/>
					</td>
					<td>
						<div id="unit"></div>
					</td>
					<td rowspan="5">
						<div id="model"></div>
					</td>
				</tr>
				<tr align="left" height="26px">
					<td>Type value:</td>
					<td><select style="width:206px" name="integer" id="integer">
							<option value="0">Float</option>
							<option value="1">Integer</option>
						</select>
					</td>
				</tr>
				<!--<tr height="26px">
					<td>price:</td>
					<td><input type="text" style="width:200px" name="price" id='price'></td>
				</tr>
				<tr height="26px">
					<td>Currency: 
						<img onClick="javascript:update('currency');" src="../../img/update.png" title="Update currency..."/>
						<img onClick="javascript:parent.showDialog('currencyform');" src="../../img/add.png" title="Add currency..."/>
					</td>
					<td>
						<div id="currency"></div>
					</td>
				</tr>-->
				<tr height="26px">
					<td>Safety Stock:</td>
					<td><input type="text" style="width:200px" name="safety_stock" id="safety_stock"></td>
				</tr>	
				<tr height="26px">
					<td>Planning Type:</td>
					<td>
						<select style="width:206px" name="planning_type" id="planning_type">
							<option value="0">MANUAL</option>
							<option value="1">SYSTEM</option>
						</select>
					</td>
				</tr>	
				<tr height="26px">
					<td>Planning Condition:</td>
					<td><input type="text" style="width:200px" name="planning_condition" id="planning_condition"></td>
				</tr>
				
				<tr>
					<td colspan="3" align="right">
						<button type="submit" style="width:150px">Add Spare parts</button>
					</td>
				</tr>
			</table>
		</form>
		<script language="javascript">
			$(function() {
				update("model");
				//update("currency");
				update("unit");
				parent.update_api.mspdialog.model.func = update;
				parent.update_api.mspdialog.currency.func = update;
				parent.update_api.mspdialog.unit.func = update;
				parent.edititem = getItem;
				$("#mspform").ajaxForm(function() {
					alert("Added!!!");
					parent.update_api.update('mspdialog');
					$('#mspform').resetForm();
				});
			});
		</script>
	</body>
</html>
